import { App } from "vue"
import "element-plus/dist/index.css"
import {
  Calendar,
  User,
  Iphone,
  Location,
  ChatLineSquare,
  Monitor,
  Setting,
  Shop,
  Goods,
  ChatLineRound,
  Fold,
  Expand,
  ArrowDown,
  Search,
  Refresh,
  InfoFilled,
} from "@element-plus/icons-vue"

import {
  ElButton,
  ElInput,
  ElTabPane,
  ElTabs,
  ElIcon,
  ElForm,
  ElFormItem,
  ElCheckbox,
  ElLink,
  ElContainer,
  ElAside,
  ElHeader,
  ElMain,
  ElMenu,
  ElSubMenu,
  ElMenuItemGroup,
  ElMenuItem,
  ElBreadcrumb,
  ElBreadcrumbItem,
  ElAvatar,
  ElDropdown,
  ElDropdownItem,
  ElDropdownMenu,
  ElRow,
  ElCol,
  ElDatePicker,
  ElSelect,
  ElOption,
  ElTable,
  ElTableColumn,
  ElPagination,
  ElImage,
  ElPopconfirm,
  ElMessage,
  ElDialog,
  ElTree,
  ElCard,
} from "element-plus"

const components = [
  ElButton,
  ElInput,
  ElTabPane,
  ElTabs,
  ElIcon,
  Calendar,
  User,
  Iphone,
  ElForm,
  ElFormItem,
  ElCheckbox,
  ElLink,
  ElContainer,
  ElAside,
  ElHeader,
  ElMain,
  ElMenu,
  ElSubMenu,
  ElMenuItemGroup,
  ElMenuItem,
  Location,
  ChatLineSquare,
  Monitor,
  Setting,
  Shop,
  ChatLineRound,
  Goods,
  Fold,
  Expand,
  ElBreadcrumbItem,
  ElBreadcrumb,
  ElAvatar,
  ElDropdown,
  ElDropdownItem,
  ElDropdownMenu,
  ArrowDown,
  ElRow,
  ElCol,
  ElDatePicker,
  Search,
  Refresh,
  ElSelect,
  ElOption,
  ElTableColumn,
  ElTable,
  ElPagination,
  ElImage,
  InfoFilled,
  ElPopconfirm,
  ElMessage,
  ElDialog,
  ElTree,
  ElCard,
]

export default function registerElementPlus(app: App): void {
  components.forEach((component) => {
    // 注册全局组件
    app.component(component.name, component)
  })
}
